package main

import (
	"encoding/json" // json decode package
	"fmt"
	"io"
	"strings" // strings.NewReader
)

func main() {
	defer func() {
		if err := recover(); err != nil {
			fmt.Println(err)
		}
	}()
	type users struct { // type users recive json decode
		Name string
	}
	const str = `{"Name":"jack"}
   {"Name":"kkkk"}
   ` // json string
	dec := json.NewDecoder(strings.NewReader(str)) // new Decode
	for {
		var us users
		if erro := dec.Decode(&us); erro == io.EOF { // decode and break on io.EOF
			break
		} else if erro != nil {
			panic(erro)
		}
		fmt.Printf("Name : %s\n", us.Name) // print result
	}
}
